<form name="operationsForm" role='form' class="form-horizontal">

    <div class="form-control">
                             <span class="glyphicon glyphicon-circle-arrow-left"
                                   ng-click="changeDate(-1);"></span>
        {{date|date}}
                             <span class="glyphicon glyphicon-circle-arrow-right"
                                   ng-click="changeDate(1);"></span>
    </div>
    <div class="form-group">
        <label ng-show="operationId"
               class=" col-xs-offset-1 control-label">Edit {{mode}}</label>
        <label ng-hide="operationId"
               class=" col-xs-offset-1 control-label">Create new {{mode}}</label>


    </div>
    <div  class="form-group">
        <label class="col-xs-2 control-label">value:</label>

        <div class="col-xs-3">
            <input class="form-control" type="number" placeholder="Sum"
                   ng-model="$parent.incomeValue">
        </div>

        <label class="col-xs-2  control-label">account:</label>

        <div class="col-xs-5">
            <select class="form-control" ng-model="$parent.incomeAccountId"
                    ng-options="account.id as account.name for account in accounts">
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label">category:</label>

        <div class="col-xs-6" ordered-list="incomeCategories" index="incomeCategoriesIndex"
             id="$parent.incomeCategoryId" editable="false" open="$parent.isCategoriesOpen">
        </div>
    </div>

    <div class="form-group">
        <label class="col-xs-2 control-label">comment:</label>

        <div class="col-xs-8">
            <textarea class="form-control" rows="2" ng-model="$parent.comment"></textarea>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-1 col-xs-offset-1">
            <button class='btn btn-primary' ng-click='addOperation()'
                    ng-disabled="incomeValue==null||incomeAccountId==null||incomeCategoryId==null"> Save </button>
        </div>
        <div class="col-xs-1 col-xs-offset-1">
            <button ng-show="operationId"
                    class='btn btn-danger' ng-click='deleteOperation(operationId)'>Delete</button>
        </div>
        <div class="col-xs-1 col-xs-offset-5">
            <button class='btn btn-default' ng-click='eraseForm()'>Cancel</button>
        </div>
    </div>

</form>